package com.gjm.ai.config;

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.client.advisor.SimpleLoggerAdvisor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ChatClientConfig {

    @Autowired
    private SimpleLoggerAdvisor simpleLoggerAdvisor;

    @Bean
    public ChatClient ChatClient(ChatClient.Builder chatClientBuilder) {
        return chatClientBuilder
                .defaultSystem("你是一个大学生，可以为我解决学习和生活上的问题")
                .defaultAdvisors(simpleLoggerAdvisor)
                .build();
    }
}
